/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package prove;

import java.awt.Color;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;

/**
 *
 * @author paolo
 */
public class Frame extends JFrame{

    private JFrame frm;
    private JButton[] carte;

    public Frame(){
        this.setFrame("Tre sette - Paolo Ricciuti (C)", 1000, 700, new Point (100,50), Color.BLUE);
        this.setButton(10);
    }

    public void setFrame(String pTitle, int pX, int pY, Point pLocation, Color pSfondo){
        this.frm= new JFrame(pTitle);
        this.frm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.frm.setSize(pX, pY);
        this.frm.setLocation(pLocation);
        this.frm.setBackground(pSfondo);
        this.frm.setVisible(true);

    }

    public void setButton(int pNum){
        this.carte= new JButton[pNum];
        for(int i=0; i<pNum; i++){
            this.carte[i]= new JButton();
            this.carte[i].setText("Carta "+i+" "+pNum);
            this.carte[i].setSize(90, 200);
            this.carte[i].setLocation(100*i, 400);            this.carte[i].setVisible(true);
            this.frm.add(this.carte[i]);
        }
    }

}
